<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<?php $title = '编辑名片'; ?>
<head>
	<meta charset="UTF-8">
	<title><?php echo ($title); ?></title>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
	<link rel="stylesheet" href="/Application/Home/View//Public/static/css/weui.min.css"/>
    <link rel="stylesheet" href="/Application/Home/View//Public/static/css/jquery-weui.min.css"/>
    <link rel="stylesheet" href="/Application/Home/View//Public/static/css/custom.css"/>
    <style type="text/css">
		body{
			background:#f1f1f1;
			color:#a3a3a3;
			font-family:"Microsoft YaHei";
		}
		.bd{
			padding:20px;
		}
        li{list-style: none;}
		p{
			font-size: 13px;
		}
		.weui-cell_select-before .weui-cell__hd:before{
			border-width: 0px 2px 2px 0;
			margin-top: -6px;
		}
		.weui-cell_select-before .weui-cell__hd:after{border:none;}
        .sstmb {
            padding-bottom: 60px;
        }
        .foot-ul{
			text-align:center;
			margin-top: 1rem;
			padding:10px;
			background: #22a9fe;
			opacity: 0.9;
		}
		.foot-ul a{
			color: #fff;
		}
		.foot-ul a img{
			max-width: 24px;
		}
		.pinglun{
			padding: 0 2px;
			background: #ff5959;
			border-radius: 50px;
			color: #fff;
			position: absolute;
			top:-6px;
			left:73px;
			font-size: 13px;
		}
		
		
		.weui-cell__bd p{
		color:#6b6969;
		}
        
	</style>
</head>

<body ontouchstart>


  <style type="text/css">
    p{
      /*  font-weight: bold; */
       font-size: 15px;
    }
    
    .weui-cell:before{
      right:15px;
    }
    form{margin:0;padding:0;}
    .weui-cells{
      margin-top: 0;
    }
    body{
      color:#3b3b3b;
      font-family:"Microsoft YaHei";
      overflow-x:hidden;
    }
    .weui-cell__ft p{
      color:#189ce0;
      margin-right:.5rem
    }
    .weui-cell__ft img{
      width:3.5rem;
      margin-right:.3rem;
      display:block;
      border-radius: 80px;
    }
   .weui-cell{background:white;}
   
   .weui-label {
    
    font-size: 15px;
}
  .weui-input {
   color:#007dd6;
  }
    
  </style>
    <div class="container js_container">

    </div>

<div class="page">
    
 <header class="demos-header head-title">
	<a class="back" href="<?php echo U('Card/index');?>&userid=<?php echo (session('userid')); ?>">
      <img style="width:10px;" src="/Application/Home/View//Public/static/images/back.png">
	</a>
	  <span>名片编辑</span>
<!--	<a class="home" href="<?php echo U('Card/index');?>&userid=<?php echo (session('userid')); ?>">  
	  <img src="/Application/Home/View//Public/static/images/home.png">
	</a>  -->
 </header>

 <div class="weui-cells__title">基础资料</div>
            <form method="POST" action='<?php echo U("index/post_img");?>' enctype="multipart/form-data" id="avatar_form">
            <a style="height: auto;border-bottom:1px solid #f5f5f5" class="weui-cell weui-cell_access" href="javascript:;">
              <div class="weui-cell__bd">
                <p>头像</p>
              </div>
              <div class="weui-cell__ft">
              <input class="weui-uploader__input" type="file" onchange='layer.open({type: 2});$("#avatar_form").submit();' id="avatar" name="avatar" accept="image/*" >
              <?php if($m_row["avatar"] != ""): ?><img src="/uploads/<?php echo ($m_row["avatar"]); ?>" id="avatar_img" />
              <?php else: ?>
              <img src="/Application/Home/View//Public/static/images/ed03.png" id="avatar_img" /><?php endif; ?>
              </div>
            </a>
            </form>
            
            <form method="POST" action='<?php echo U("index/post_img");?>' enctype="multipart/form-data"  id="qrcode_form">
            <a style="height: auto;border-bottom:1px solid #f5f5f5" class="weui-cell weui-cell_access" href="javascript:;" >
              <div class="weui-cell__bd">
                <p>微信二维码</p>
              </div>
              <div class="weui-cell__ft">
              <input class="weui-uploader__input" type="file"  onchange='layer.open({type: 2});$("#qrcode_form").submit();' name="wechat_qrcode" id="wechat_qrcode"  accept="image/*" >
              <img style="width:60%;border-radius: 0;" src="/Application/Home/View//Public/static/images/ed1.png" id="qrcode_img" />
              </div>
              
            </a>
            </form>
            <form method="POST" action="<?php echo U('index/card_edit');?>" id='card_form'>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">姓名</label></div>
                <div class="weui-cell__bd">
                  <input class="weui-input" type="text" name='true_name' value="<?php echo ($m_row["true_name"]); ?>" placeholder="必填">
                </div>
              </div>
             
            
              <a class="weui-cell weui-cell_access" href="javascript:;">
                <div class="weui-cell__bd"><label for="name" class="weui-label">性别</label></div>
                  <div class="weui-cell__ft">
                    <input style="text-align: right;margin-right:.5rem;width:95%;color: #189ce0;" class="weui-input" name="sex" id="sex" type="text" value="<?php if($m_row["sex"] == 2): ?>女<?php else: ?>男<?php endif; ?>">
                  </div>
              </a>
              
               <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">微信号</label></div>
                <div class="weui-cell__bd">
                  <input class="weui-input" type="text" placeholder="选填" name="wechat" value="<?php echo ($m_row["wechat"]); ?>" >
                </div>
              </div>
			  
			   <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">手机号</label></div>
                <div class="weui-cell__bd">
                  <input class="weui-input" type="text" placeholder="必填" name="telephone" value="<?php echo ($m_row["telephone"]); ?>" >
                </div>
              </div>
			  
			  <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">QQ</label></div>
                <div class="weui-cell__bd">
                  <input class="weui-input" type="text" placeholder="选填" name="qq" value="<?php echo ($m_row["qq"]); ?>" >
                </div>
              </div>
			  
			  <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">邮箱</label></div>
                <div class="weui-cell__bd">
                  <input class="weui-input" type="text" placeholder="选填" name="email" value="<?php echo ($m_row["email"]); ?>" >
                </div>
              </div>
			  
			  <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">网址</label></div>
                <div class="weui-cell__bd">
                  <input class="weui-input" type="text" placeholder="选填" name="weburl" value="<?php echo ($m_row["weburl"]); ?>" >
                </div>
              </div>
            
            <a class="weui-cell weui-cell_access" href="<?php echo U('Card/edit_brief');?>&type=1">
              <div class="weui-cell__bd">
                <p>个人简介</p>
              </div>
              <div class="weui-cell__ft">
              </div>
            </a>
            
              <div class="weui-cells__title">公司信息</div>
             
             <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">公司</label></div>
                <div class="weui-cell__bd">
                  <input class="weui-input" type="text" placeholder="必填" name="company_name" value="<?php echo ($m_row["company_name"]); ?>">
                </div>
              </div>
              
              
             <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">行业/方向</label></div>
                <div class="weui-cell__bd">
                  <input class="weui-input" type="text" placeholder="选填" name="profession" value="<?php echo ($m_row["profession"]); ?>">
                </div>
              </div>
              
              <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">职位</label></div>
                <div class="weui-cell__bd">
                  <input class="weui-input" type="text" placeholder="必填" id='position' name="position" value="<?php echo ($m_row["position"]); ?>">
                </div>
              </div>
              
               <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">职业标签</label></div>
                <div class="weui-cell__bd">
                  <input class="weui-input" type="text" placeholder="选填" name="pos_tags" value="<?php echo ($m_row["pos_tags"]); ?>">
                </div>
              </div>
              <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">地址</label></div>
                <div class="weui-cell__bd">
                  <input class="weui-input" type="text" placeholder="必填" name="address" value="<?php echo ($m_row["address"]); ?>">
                </div>
              </div>
            
            <a class="weui-cell weui-cell_access" href="<?php echo U('Card/edit_brief');?>&type=2">
              <div class="weui-cell__bd">
                <p>公司简介</p>
              </div>
              <div class="weui-cell__ft">
              </div>
            </a>
         
            <div class="weui-cells__title">其他</div>
              <a class="weui-cell weui-cell_access" href="<?php echo U('ServiceItem/index');?>">
              <div class="weui-cell__bd">
                <p>服务内容</p>
              </div>
              <div class="weui-cell__ft">
              </div>
            </a>
          
         <div style="margin:2rem auto;width:12rem;border-radius:20px;" class="demos-content-padded">
      <button style="background:#22a9fe;" class="weui-btn weui-btn_primary">保存</button>
      
	 </div>
   </form>
    <script src="/Application/Home/View//Public/static/js/jquery-2.1.4.js"></script>
    <script src="/Application/Home/View//Public/static/js/jquery-weui.min.js"></script>
    <script src="/Application/Home/View//Public/static/js/fastclick.js"></script>
    <script src="/Application/Home/View//Public/static/layer/layer.js"></script>
    <script src="/Application/Home/View//Public/static/js/jquery.form.js"></script>
    <script>
      $(function() {
        FastClick.attach(document.body);
      });
    </script>
</body>
</html>
 <script>
      $(function(){
          $("#card_form").ajaxForm(function(data){
              if(data == 1){
                  $.alert('保存成功!');
              }else{
                  $.alert('保存失败,请稍后重试!')
              }
          })
          
          var options = {
            success: up_success,
            error:up_error,
            timeout:15000
          }
          
          function up_error(responseText, statusText){
            if(statusText=='timeout'){
                layer.closeAll();
                $.alert("上传图片大或网速慢，请稍后重试!");
                return;
            }
          }
          
          
          function up_success(data){
		      layer.closeAll();
              var data = JSON.parse(data);
              if(data.status == 1){
                  var img_url = data.msg;
                  $("#avatar_img").attr('src', img_url);
              }else{
                  $.alert(data.msg);
              }
          }
          
          $("#avatar_form").ajaxForm(options)
          
          $("#qrcode_form").ajaxForm(function(data){
		      layer.closeAll();
              var data = JSON.parse(data);
              if(data.status == 1){
                  $.alert('上传成功!');
              }else{
                  $.alert(data.msg);
              }
          })
      })
      
      $("#sex").select({
        title: "选择性别",
        items: [
          {
            title: "男",
            value: "1",
          },
          {
            title: "女",
            value: "2",
          },
        ]
      });
      
      
     /* $("#position").select({
        title: "选择职位",
        items: [
          {
            title: "董事长",
            value: "001",
          },
          {
            title: "总经理",
            value: "002",
          },
           {
            title: "运营总监",
            value: "003",
          },
           {
            title: "高级工程师",
            value: "004",
          },
           {
            title: "业务总监",
            value: "005",
          },
                     {
            title: "业务经理",
            value: "006",
          },
        ]
      });
      
      */
      
    </script>